#!/usr/bin/python

from interface import *

testcase = ["bb", "aa", "xx", "yy", "zz", "hello", "hit", "smida", "hubenzhonglangjiang", "cubao", "bidagelasi", "gougudingli", "duijiaoxian"]

testdict = {}

def test():
    for key in testcase:
        testdict[key] = key * 2

    lib = getlib('/usr/local/lib/libkvs.so')
    kv_init(lib)

    for key in testdict.keys():
        kv_put(lib, key, testdict[key])

    for key in testcase:
        value = kv_get(lib, key, 64)
        print "kv_get  %s: %s" % (key, value)

    for key in testcase:
        kv_delete(lib, key)
    
    print "exitting..."
    kv_exit(lib)

test()
